<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Anim{
            constructor(name,age){
                this.name = name;
                this.age = age;
                this.jump = function(){
                    console.log(222);
                }
            }
            //原型对象上添加方法
            hobby(){
                console.log(吃肉);
            }
            //Anim自身上添加静态属性和方法
            static color = "pink";
            static sex(){
                console.log("男");
            }
        }

        class Dog extends Anim{
            constructor(name,age,shengying){
                super(name,age);
                this.shengying = shengying;
            }
            hobby_dog(){
                console.log("hobby_dog");
                super.hobby();
            }
            static sex_dog(){
                console.log('子类自身的方法和属性');
                super.color();
            }
        }
    </script>
</body>
</html>